package com.sikaryofficial.workbench.domain.vo.goods;

import com.sikaryofficial.workbench.constant.GoodsStyleEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author : qinjinyuan
 * @desc : 商品款式分类
 * @date : 2024/09/27 17:30
 */
@Getter
@Setter
@ToString
@ApiModel(value = "商品-品牌", description = "商品-品牌")
public class GoodsCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "商品款式名称", example = "disposable,cartridge")
    private String style;
    @ApiModelProperty(value = "商品款式名称-页面展示字段")
    private String styleDesc;
    @ApiModelProperty(value = "商品品牌集合")
    private List<GoodsBrand> brands;

    public String getStyleDesc() {
        GoodsStyleEnum goodsStyleEnum = GoodsStyleEnum.getByCode(style);
        return Objects.isNull(goodsStyleEnum) ? "" : goodsStyleEnum.getDesc();
    }
}
